<?php

namespace app\pay\command;

use TelegramBot\Api\BotApi;
use think\cache\driver\Redis;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use api\v1\controller\BaseTestController;

//机器人消息阅读后自焚
class AutoClear extends Command
{
    protected function configure()
    {
        $this->setName('AutoClear')
            ->setDescription('拿队列数据');
    }

    protected function execute(Input $input, Output $output)
    {
        /*** 这里写计划任务列表集 START ***/
        //获取消息
        $base = new BaseTestController();
        $bot = new BotApi('5518362297:AAGsRw-D8WWOG0ZsaMmLjXD-pBH9hBi6Q98');
        $post = $bot->getUpdates();
        foreach ($post as $k => $v) {
            $base->index($v->toJson());
        }
        /*** 这里写计划任务列表集 END ***/
        $output->writeln('ok');
    }

}
